<!DOCTYPE html>
<html>
<head>

</head>

<body>

<button id="start_push">start_push_service</button>
<br/>
<button id="stop_push">stop_push_service</button>
<br/>
<button id="js_call">js_call</button>

<script type='text/javascript'>

    function OnMessage() {
        alert("OnMessage function called!");
    }
    //开启推送服务
     document.getElementById('start_push').onclick= function () {
       var pushNotification = window.plugins.pushNotification;
       var json = '{ "xx": "yy", "zz": jj }';
       pushNotification.register(function(){}, function(){}, json);
      }

    //关闭推送服务
     document.getElementById('stop_push').onclick= function() {
        var pushNotification = window.plugins.pushNotification;
        var json = '{ "xx": "yy", "zz": jj }';
        pushNotification.unregister(function(){},function(){},json);
     }
     //测试js调用本地接口
     document.getElementById('js_call').onclick = function() {
        //window.notificationPushMsg.callByJsMsgHandler("xxxxx","OnMessage();");
        window.notificationPushMsg.callByNative();
     }
    </script>
</body>
<script type='text/javascript' src="./cordova.js"></script>
<script type='text/javascript' src="./cordova_plugins.js"></script>
<script type='text/javascript' src="./PushNotification.js"></script>
</html>